﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Security;
using System.Security.Permissions;

namespace Toolset
{
    //[PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
    public class ToolsetPlugin : Plugins.IPlugin
    {
        #region IPlugin Members
        public string Name { get { return "Toolset"; } }
        public List<string> Command
        {
            get { return new List<string>() { "ping" }; }
        }

        public string RootStore { get; set; }

        public string Chat(string Command, string UserID, string Input)
        {
            if (Command == "ping")
            {
                try
                {
                    Ping p = new Ping();
                    return p.PingHost(Input);
                }
                catch (Exception exc)
                {
                    return "Could not ping host, an error occured.";
                }
            }
            return "";
        }

        public MSNPSharp.Messenger Messenger{get;set;}

        #endregion
    }
}
